<?php
    include '../Include/header.inc.php';
    include '../Include/funcGestionConferancier.inc.php';
    
    error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

    if($_REQUEST['action']=="add"){
        
       
        addConferancier($_POST['Nom'],$_POST['Prenom']);

    }
    
       if($_REQUEST['action']=="del"){
        
        delConferancier($_REQUEST['id']);
        
        
        
    }
    
        if($_REQUEST['action']=="modif"){
        $modif=true;
        $person=SelectConferancierById($_REQUEST['id']);

    }
    
      if($_REQUEST['action']=="update"){
      //  $modif=true;

        updateConferancier($_REQUEST['id'],$_POST['Nom'],$_POST['Prenom']);

    }
    
?>
<body id="main_body" >
	dd
	<img id="top" src="images/top.png" alt="">
	<div id="form_container">
	
		<h1><a>Ajouter Conférancier</a></h1>
		<form id="form_313895" class="appnitro"  method="post" action="conferenciers.php?action=<?php echo isset($modif) ? 'update&id='.$_REQUEST['id'] : 'add'; ?>">
					<div class="form_description">
			<h2><?php echo isset($modif) ? 'Modifier conférancier' : 'Ajouter le Conférancier'; ?> </h2>
			<p>Ajouter le COnférancier</p>
		</div>						
			<ul >
			
					<li id="li_1" >
		<label class="description" for="element_1">Information </label>
		<span>
			<input id="element_1_1" name= "Nom" class="element text" maxlength="255" size="8" value="<?php  if(isset($modif))echo$person[1] ; ?>"/>
			<label>Prenom</label>
		</span>
		<span>
			<input id="element_1_2" name= "Prenom" class="element text" maxlength="255" size="14" value="<?php if(isset($modif))echo $person[2] ; ?>"/>
			<label>Nom</label>
		</span> 
		</li>
			
					<li class="buttons">
			    <input type="hidden" name="form_id" value="313895" />
			    
				<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
		</li>
			</ul>
		</form>	
		
	
         </form>	
	<img id="bottom"  src="images/bottom.png" alt="">
        
        
        
       
 						
        <div width="100%">

                  
                    <label align="center" class="description">Conférancier</label>
                       
                            
                                <table id="aff" align="center" width="200" bgcolor=#FFFFFF border="1">
                                    
                                    
              <tr>
                <td>nom</td>
                <td>prenom</td>
                <td>Supprimer</td>
              </tr>
                <?php
                                        //Récupération de la liste des types d'oeuvres
                                        $listeType = SelectConferancier();

                                        //Parcours les types et les affiche en option
                                        while($ligne = mysql_fetch_array($listeType))
                                        {
                                            ?>
              <tr>
                <td><?php echo $ligne[1] ?></td>
                <td><?php  echo $ligne[2] ?></td>
                <td align="center" >
                    <a  onclick='return confirm("Are you sure you want to delete?")' href="conferenciers.php?action=del&id=<?php  echo $ligne[0] ?>" >
                        <img  width="20px"  height="20px" src="../pictures/Delete-icon.png" alt="Supprimer"></a>
                <a   href="conferenciers.php?action=modif&id=<?php  echo $ligne[0] ?>" >
                        <img  width="20px"  height="20px" src="../pictures/edit-icon.png" alt="Editer"></a>
                </td>
              </tr>
              
                               <?php   }   ?>
            </table>
                            
                        
        </div>    
                  		
                 </div> 
		
	
<?php
    include("../include/footer.php");
?>

